package WGH;

import java.util.ArrayList;

public class Project {
	String name;
	boolean largeProject=false;
	private ArrayList<Person> projectMembers;
	private Person ProjectHead;
	
	public boolean isLargeProject() {
		return largeProject;
	}
	public void setLargeProject(boolean largeProject) {
		this.largeProject = largeProject;
	}

	public Person getProjectHead() {
		return ProjectHead;
	}
	public void setProjectHead(Person projectHead) {
		ProjectHead = projectHead;
		projectHead.setSharable(false);
	}
	public Project(String p) {
		this.name = p;
		this.projectMembers = new ArrayList<Person>();
	}
	
	@Override
	public String toString(){
		String s = "";
		s += String.format("project(%s)\n", this.name);
		if(this.ProjectHead!=null)	s += String.format("heads-project(%s, %s)\n", this.ProjectHead.getName(),this.name);
		if(largeProject)	s += String.format("large-project(%s)\n", this.name);
		String t = "";
		for(Person p:this.projectMembers) t+= p.getName()+", ";
		if(t.length()>2)	t = t.substring(0,t.length()-2);
		t = String.format("ProjectMemeber(%s, {%s})\n", this.name,t);
		s+=t;
		return s;
	}
	public ArrayList<Person> getProjectMembers() {
		return projectMembers;
	}
	public void setProjectMembers(ArrayList<Person> projectMembers) {
		this.projectMembers = projectMembers;
	}

}
